package com.lingjtx.community.controller;

import com.lingjtx.common.core.ResponseResult;
import com.lingjtx.common.core.annotation.IgnoreLogin;
import com.lingjtx.community.service.SearchService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/search")
@RequiredArgsConstructor
public class SearchController {

    private final SearchService searchService;

    @IgnoreLogin
    @GetMapping("/{keyword}")
    public ResponseResult<List<String>> searchCaseIdsByKeyword(@PathVariable("keyword") String keyword) {
        return ResponseResult.createBySuccess(searchService.searchCaseIdsByKeyword(keyword));
    }
}
